package day7;

import java.io.File;

/**
 * @author oldliu
 * @since 1.0
 */
public class File1Test {
    public static void main(String[] args) {
        File f=new File("D:\\Documents\\桌面\\rent-freely-master\\free-room\\package-lock.json");
        //File f=new File("D:\\Documents\\桌面\\333");
        File f2=new File("D:\\Documents\\桌面","rent-freely-master");
        System.out.println(f.compareTo(f2));
        System.out.println(f.equals(f2));
        System.out.println("是否存在："+f.exists());
        System.out.println("类型：文件夹："+f.isDirectory()+",是文件？"+f.isFile());
        System.out.println("name:"+f.getName());
        System.out.println("上级："+f.getParent());
        System.out.println("大小:"+f.length()+"字节");
        System.out.println("时间："+f.lastModified());
        System.out.println("能读？"+f.canRead());
        System.out.println("能改？"+f.canWrite());
        System.out.println("能执行？"+f.canExecute());
        System.out.println("是否隐藏："+f.isHidden());
    }
}
